<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<script type="text/javascript">
$(function(){
	$("#import").click(function(){
		var numbers = encodeURIComponent($("#numbers").val());
		$.ajax({
			type: "get",
			url: "<?=url('Storage::Sales/ImportTrackingNumberFormSave')?>&numbers=" + numbers,
			dataType: "json",
			success:
				function (data)
				{
					if(data['ack'] == 'success')
					{
						var result = '<font style="font-weight:bold; color: red">' + data['message'] + '<br />';
						result += '导入成功的追踪号数目有：' + data['success_number'] + '<br />';
						result += '导入失败的追踪号数目有：' + data['failure_number'] + '</font>';
						$("#result").html(result);
					}
					else
					{
						var result = '<font style="font-weight:bold; color: red">' + data['message'] + '</font>';
						$("#result").html(result);
					}
				}
		});
	});
});
</script>
<h3>导入追踪号(txt/xls)</h3>
<form action="<?=url('Storage::Sales/ImportTrackingNumberSave')?>" method="post" enctype="multipart/form-data">
<p>1.选择文件 <input type="file" name="tracking_number" /></p>
<p>2.导入文件 <input type="submit" class="button" value="导入" /></p>
</form><br />
<h3>导入飞特追踪号(csv)</h3>
<form action="<?=url('Storage::Sales/ImportFLYTTrackingNumberSave')?>" method="post" enctype="multipart/form-data">
<p>1.选择文件 <input type="file" name="FLYT_tracking_number" /></p>
<p>2.导入文件 <input type="submit" class="button" value="导入" /></p>
</form><br />
<h3>导入追踪号(表单)</h3>
<form action="<?=url('Storage::Sales/ImportTrackingNumberFormSave')?>" method="post">
<table>
<tr>
	<td><textarea rows="10" cols="50" name="numbers" id="numbers"></textarea></td>
	<td id="result"></td>
</tr>
<tr>
	<td colspan="2"><input type="button" class="button" id="import" value="导入" /></td>
</tr>
</table>
</form>
<?php $this->_endblock(); ?>